package com.lt.bcra.service;

import com.lt.bcra.entity.BcraPersonalInfo;
import com.lt.bcra.entity.vo.BcraPersonalInfoVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lt.bcra.exception.BaseException;
import com.lt.bcra.result.ResultData;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 用户信息登录注册表 服务类
 * </p>
 *
 * @author LuoTian
 * @since 2022-05-23
 */
public interface BcraPersonalInfoService extends IService<BcraPersonalInfo> {

    ResultData listByPages(Long current, Long size, BcraPersonalInfoVo bcraPersonalInfoVo);

    /**
     * 用户注册
     * @param bcraPersonalInfo
     * @return
     */
    ResultData registerUser(BcraPersonalInfo bcraPersonalInfo);

    /**
     * 修改用户信息
     * @param bcraPersonalInfo
     * @return
     */
    ResultData updateInfo(BcraPersonalInfo bcraPersonalInfo);

    /**
     * 冻结用户
     * @param id
     * @return
     */
    ResultData frozenUser(Integer id);

    /**
     * 查询全部手机号
     * @return
     */
    ResultData getAllPhone();

    /**
     * 用户登录
     * @return
     */
    ResultData loginUser(String phone,String password);

    /**
     * 表格信息导出
     * @param response
     * @param bcraPersonalInfoVo
     */
    void exportExcel(HttpServletResponse response, BcraPersonalInfoVo bcraPersonalInfoVo) throws BaseException;

    /**
     * 手机验证码登录
     * @param phone
     * @return
     */
    ResultData loginBySms(String phone);

    /**
     * TOKEN令牌校验
     * @param request
     * @return
     */
    ResultData checkToken(HttpServletRequest request);

    /**
     * 利用openid判断数据库是否已经含有用户信息
     * @param openid
     * @return
     */
    BcraPersonalInfo selectWxInfoOpenId(String openid);
}
